<%-- 
    Document   : View Course Sections by Professor/Students
    Created on : Nov 6, 2013, 11:51:15 PM
    Author     : reynier
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../assets/ico/favicon.png">

    <title>GRS View Course Sections</title>

    <!-- Bootstrap core CSS -->
    <link href="../libs/bootstrap/css/bootstrap.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="../../assets/js/html5shiv.js"></script>
      <script src="../../assets/js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>
      <header>
        <nav class="navbar navbar-default" role="navigation">
            <div class="navbar-header"><p class="navbar-text navbar-left">Grade Report System</p></div>
            <form class="navbar-form navbar-right" method="post" action="../login" >
                <div class="form-group">Signed in as ${sessionScope.UserName}</div>
                <button id="logout" name="logout" type="submit" class="btn btn-link">(Log out)</button>
            </form>
        </nav>    
    </header>
    <div class="container">
        <div id="successMessageContainer" class="alert alert-success" style="display: none;">
            <a class="close" data-dismiss="alert" href="#">×</a><span id="successMessage">${messages.success}</span>
        </div>
        <div id="errorMessageContainer" class="alert alert-danger" style="display: none;">
            <a class="close" data-dismiss="alert" href="#">×</a><span id="errorMessage">${messages.error}</span>
        </div>
      <h2>My Course Sections</h2>
      <p class="lead">Courses sections that you are assigned into.</p>
      <form class="form-group" method="post" action="viewCourseSections" >
          <input type="hidden" name="sectionId" id="sectionId">
          <button type="submit" hidden="hidden" name="gotoSection" id="gotoSection"></button>
          <div class="list-group">
              <c:forEach items="${sections}" var="section">
                <a href="#" class="list-group-item" id="lnkGotoSection">
                    <input type="hidden" name="sectionId_${section.getSectionID()}" id="sectionId_${section.getSectionID()}" value="${section.getSectionID()}">
                    <h4 class="list-group-item-heading">(${section.getSectionName()}) <span class="text-info"> ${section.getCourse().getCourseCode()} - ${section.getCourse().getCourseName()}</span></h4>
                    <p class="list-group-item-text">${section.getProfessor().getFirstName()} ${section.getProfessor().getLastName()}</p>
                </a>
              </c:forEach>
          </div>
      </form>
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <script src="../libs/jquery/jquery-2.0.3.min.js"></script>
    <script src="../libs/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../scripts/viewCourseSections.js"></script>
    <!-- Placed at the end of the document so the pages load faster -->
  </body>
</html>

